package com.hxnidc.horizontaltest;

import java.text.DecimalFormat;

/**
 * Created by on 2017/9/13 15:50
 * Author：yrg
 * Describe:
 */


public class StringUtils {

    public static String division(int a, int b) {
        String result = "";
        float num = (float) a / b;

        DecimalFormat df = new DecimalFormat("0.0");

        result = df.format(num);

        return result;

    }

    public static String format(double d) {
        try {
            DecimalFormat df = new DecimalFormat("#.0");
            return df.format(d);
        } catch (Exception e) {

        }
        return null;
    }
}
